{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "importrt pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "s = pd.read_csv(r'data/emaotai.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>时间</th>\n",
       "      <th>商品名</th>\n",
       "      <th>商品编号</th>\n",
       "      <th>品牌</th>\n",
       "      <th>价格</th>\n",
       "      <th>浏览量</th>\n",
       "      <th>已售出量</th>\n",
       "      <th>库存量</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>276</th>\n",
       "      <td>2017-08-21 21:35:55</td>\n",
       "      <td>贵州茅台酒 新飞天茅台酒53度500ml茅台官方商城正品直供</td>\n",
       "      <td>23</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>1299.0</td>\n",
       "      <td>3168779</td>\n",
       "      <td>143799</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>234</th>\n",
       "      <td>2017-08-20 23:05:03</td>\n",
       "      <td>贵州茅台酒 新飞天茅台酒53度500ml茅台官方商城正品直供</td>\n",
       "      <td>23</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>1299.0</td>\n",
       "      <td>3022292</td>\n",
       "      <td>142737</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>2017-08-16 14:06:34</td>\n",
       "      <td>贵州茅台酒 新飞天茅台酒53度500ml茅台官方商城正品直供</td>\n",
       "      <td>23</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>1299.0</td>\n",
       "      <td>2825761</td>\n",
       "      <td>142409</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67</th>\n",
       "      <td>2017-08-08 00:11:23</td>\n",
       "      <td>贵州茅台酒 新飞天茅台酒53度500ml茅台官方商城正品直供</td>\n",
       "      <td>23</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>1299.0</td>\n",
       "      <td>2549637</td>\n",
       "      <td>138833</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>289</th>\n",
       "      <td>2017-08-21 21:35:55</td>\n",
       "      <td>贵州茅台酒（2017丁酉鸡年）53度500ml【按农历生肖属相推出】</td>\n",
       "      <td>1618</td>\n",
       "      <td>生肖纪念酒</td>\n",
       "      <td>1599.0</td>\n",
       "      <td>4757883</td>\n",
       "      <td>41327</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>192</th>\n",
       "      <td>2017-08-20 23:05:03</td>\n",
       "      <td>贵州茅台酒（2017丁酉鸡年）53度500ml【按农历生肖属相推出】</td>\n",
       "      <td>1618</td>\n",
       "      <td>生肖纪念酒</td>\n",
       "      <td>1599.0</td>\n",
       "      <td>4683796</td>\n",
       "      <td>41211</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>114</th>\n",
       "      <td>2017-08-16 14:06:34</td>\n",
       "      <td>贵州茅台酒（2017丁酉鸡年）53度500ml【按农历生肖属相推出】</td>\n",
       "      <td>1618</td>\n",
       "      <td>生肖纪念酒</td>\n",
       "      <td>1599.0</td>\n",
       "      <td>4500116</td>\n",
       "      <td>41097</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>72</th>\n",
       "      <td>2017-08-08 00:11:23</td>\n",
       "      <td>贵州茅台酒（2017丁酉鸡年）53度500ml【按农历生肖属相推出】</td>\n",
       "      <td>1618</td>\n",
       "      <td>生肖纪念酒</td>\n",
       "      <td>1599.0</td>\n",
       "      <td>4079797</td>\n",
       "      <td>40317</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>115</th>\n",
       "      <td>2017-08-16 14:06:34</td>\n",
       "      <td>贵州茅台酒 五星茅台酒53度500ml 茅台官方商城正品直供</td>\n",
       "      <td>3</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>1289.0</td>\n",
       "      <td>377555</td>\n",
       "      <td>14397</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>242</th>\n",
       "      <td>2017-08-20 23:05:03</td>\n",
       "      <td>贵州茅台酒 五星茅台酒53度500ml 茅台官方商城正品直供</td>\n",
       "      <td>3</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>1289.0</td>\n",
       "      <td>386706</td>\n",
       "      <td>14397</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75</th>\n",
       "      <td>2017-08-08 00:11:23</td>\n",
       "      <td>贵州茅台酒 五星茅台酒53度500ml 茅台官方商城正品直供</td>\n",
       "      <td>3</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>1289.0</td>\n",
       "      <td>361777</td>\n",
       "      <td>14397</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>299</th>\n",
       "      <td>2017-08-21 21:35:55</td>\n",
       "      <td>贵州茅台酒 五星茅台酒53度500ml 茅台官方商城正品直供</td>\n",
       "      <td>3</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>1289.0</td>\n",
       "      <td>391897</td>\n",
       "      <td>14397</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>2017-08-08 00:11:23</td>\n",
       "      <td>贵州茅台酒新飞天茅台53度500ml（6瓶整箱购买）茅台官方商城正品直供</td>\n",
       "      <td>1044</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>7794.0</td>\n",
       "      <td>453173</td>\n",
       "      <td>14175</td>\n",
       "      <td>仅供展示</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>200</th>\n",
       "      <td>2017-08-20 23:05:03</td>\n",
       "      <td>贵州茅台酒新飞天茅台53度500ml（6瓶整箱购买）茅台官方商城正品直供</td>\n",
       "      <td>1044</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>7794.0</td>\n",
       "      <td>524047</td>\n",
       "      <td>14175</td>\n",
       "      <td>仅供展示</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>2017-08-16 14:06:34</td>\n",
       "      <td>贵州茅台酒新飞天茅台53度500ml（6瓶整箱购买）茅台官方商城正品直供</td>\n",
       "      <td>1044</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>7794.0</td>\n",
       "      <td>478854</td>\n",
       "      <td>14175</td>\n",
       "      <td>仅供展示</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>298</th>\n",
       "      <td>2017-08-21 21:35:55</td>\n",
       "      <td>贵州茅台酒新飞天茅台53度500ml（6瓶整箱购买）茅台官方商城正品直供</td>\n",
       "      <td>1044</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>7794.0</td>\n",
       "      <td>532944</td>\n",
       "      <td>14175</td>\n",
       "      <td>仅供展示</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>290</th>\n",
       "      <td>2017-08-21 21:35:55</td>\n",
       "      <td>贵州茅台酒 飞天茅台酒53度200ml茅台官方商城正品直供</td>\n",
       "      <td>5</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>589.0</td>\n",
       "      <td>127286</td>\n",
       "      <td>6372</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>162</th>\n",
       "      <td>﻿2017-08-20 23:05:03</td>\n",
       "      <td>贵州茅台酒 飞天茅台酒53度200ml茅台官方商城正品直供</td>\n",
       "      <td>5</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>589.0</td>\n",
       "      <td>126785</td>\n",
       "      <td>6372</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>2017-08-08 00:11:23</td>\n",
       "      <td>贵州茅台酒 飞天茅台酒53度200ml茅台官方商城正品直供</td>\n",
       "      <td>5</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>589.0</td>\n",
       "      <td>123244</td>\n",
       "      <td>6372</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>153</th>\n",
       "      <td>2017-08-16 14:06:34</td>\n",
       "      <td>贵州茅台酒 飞天茅台酒53度200ml茅台官方商城正品直供</td>\n",
       "      <td>5</td>\n",
       "      <td>贵州茅台酒</td>\n",
       "      <td>589.0</td>\n",
       "      <td>125573</td>\n",
       "      <td>6372</td>\n",
       "      <td>0瓶</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       时间                                    商品名  商品编号     品牌  \\\n",
       "276   2017-08-21 21:35:55         贵州茅台酒 新飞天茅台酒53度500ml茅台官方商城正品直供    23  贵州茅台酒   \n",
       "234   2017-08-20 23:05:03         贵州茅台酒 新飞天茅台酒53度500ml茅台官方商城正品直供    23  贵州茅台酒   \n",
       "98    2017-08-16 14:06:34         贵州茅台酒 新飞天茅台酒53度500ml茅台官方商城正品直供    23  贵州茅台酒   \n",
       "67    2017-08-08 00:11:23         贵州茅台酒 新飞天茅台酒53度500ml茅台官方商城正品直供    23  贵州茅台酒   \n",
       "289   2017-08-21 21:35:55     贵州茅台酒（2017丁酉鸡年）53度500ml【按农历生肖属相推出】  1618  生肖纪念酒   \n",
       "192   2017-08-20 23:05:03     贵州茅台酒（2017丁酉鸡年）53度500ml【按农历生肖属相推出】  1618  生肖纪念酒   \n",
       "114   2017-08-16 14:06:34     贵州茅台酒（2017丁酉鸡年）53度500ml【按农历生肖属相推出】  1618  生肖纪念酒   \n",
       "72    2017-08-08 00:11:23     贵州茅台酒（2017丁酉鸡年）53度500ml【按农历生肖属相推出】  1618  生肖纪念酒   \n",
       "115   2017-08-16 14:06:34         贵州茅台酒 五星茅台酒53度500ml 茅台官方商城正品直供     3  贵州茅台酒   \n",
       "242   2017-08-20 23:05:03         贵州茅台酒 五星茅台酒53度500ml 茅台官方商城正品直供     3  贵州茅台酒   \n",
       "75    2017-08-08 00:11:23         贵州茅台酒 五星茅台酒53度500ml 茅台官方商城正品直供     3  贵州茅台酒   \n",
       "299   2017-08-21 21:35:55         贵州茅台酒 五星茅台酒53度500ml 茅台官方商城正品直供     3  贵州茅台酒   \n",
       "76    2017-08-08 00:11:23   贵州茅台酒新飞天茅台53度500ml（6瓶整箱购买）茅台官方商城正品直供  1044  贵州茅台酒   \n",
       "200   2017-08-20 23:05:03   贵州茅台酒新飞天茅台53度500ml（6瓶整箱购买）茅台官方商城正品直供  1044  贵州茅台酒   \n",
       "148   2017-08-16 14:06:34   贵州茅台酒新飞天茅台53度500ml（6瓶整箱购买）茅台官方商城正品直供  1044  贵州茅台酒   \n",
       "298   2017-08-21 21:35:55   贵州茅台酒新飞天茅台53度500ml（6瓶整箱购买）茅台官方商城正品直供  1044  贵州茅台酒   \n",
       "290   2017-08-21 21:35:55          贵州茅台酒 飞天茅台酒53度200ml茅台官方商城正品直供     5  贵州茅台酒   \n",
       "162  ﻿2017-08-20 23:05:03          贵州茅台酒 飞天茅台酒53度200ml茅台官方商城正品直供     5  贵州茅台酒   \n",
       "58    2017-08-08 00:11:23          贵州茅台酒 飞天茅台酒53度200ml茅台官方商城正品直供     5  贵州茅台酒   \n",
       "153   2017-08-16 14:06:34          贵州茅台酒 飞天茅台酒53度200ml茅台官方商城正品直供     5  贵州茅台酒   \n",
       "\n",
       "         价格      浏览量    已售出量   库存量  \n",
       "276  1299.0  3168779  143799    0瓶  \n",
       "234  1299.0  3022292  142737    0瓶  \n",
       "98   1299.0  2825761  142409    0瓶  \n",
       "67   1299.0  2549637  138833    0瓶  \n",
       "289  1599.0  4757883   41327    0瓶  \n",
       "192  1599.0  4683796   41211    0瓶  \n",
       "114  1599.0  4500116   41097    0瓶  \n",
       "72   1599.0  4079797   40317    0瓶  \n",
       "115  1289.0   377555   14397    0瓶  \n",
       "242  1289.0   386706   14397    0瓶  \n",
       "75   1289.0   361777   14397    0瓶  \n",
       "299  1289.0   391897   14397    0瓶  \n",
       "76   7794.0   453173   14175  仅供展示  \n",
       "200  7794.0   524047   14175  仅供展示  \n",
       "148  7794.0   478854   14175  仅供展示  \n",
       "298  7794.0   532944   14175  仅供展示  \n",
       "290   589.0   127286    6372    0瓶  \n",
       "162   589.0   126785    6372    0瓶  \n",
       "58    589.0   123244    6372    0瓶  \n",
       "153   589.0   125573    6372    0瓶  "
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.sort_values(by='已售出量', ascending=False).head(20)"
   ]
  }
 ],
 "metadata": {
  "hide_input": false,
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  },
  "toc": {
   "colors": {
    "hover_highlight": "#DAA520",
    "navigate_num": "#000000",
    "navigate_text": "#333333",
    "running_highlight": "#FF0000",
    "selected_highlight": "#FFD700",
    "sidebar_border": "#EEEEEE",
    "wrapper_background": "#FFFFFF"
   },
   "moveMenuLeft": true,
   "nav_menu": {
    "height": "12px",
    "width": "252px"
   },
   "navigate_menu": true,
   "number_sections": true,
   "sideBar": true,
   "threshold": 4,
   "toc_cell": false,
   "toc_section_display": "block",
   "toc_window_display": false,
   "widenNotebook": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
